<?php

namespace app\api\controller\v1;

use app\common\controller\Api;
use app\common\logic\LeescoreLogic;
use think\Db;
use think\Request;
use app\common\model\custom\Article as ArticleModel;

/**
 * Token接口
 */
class Article extends Api
{
    protected $noNeedLogin = ['web', 'wxArticle'];
    protected $noNeedRight = '*';
    protected $shopLogic = null;

    protected $config = [
        'about_us' => 1
    ];
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
    }

    public function web() {
        $tag = input('tag/s', 'about_us');
        $id = $this->config[$tag];
        if (!$id) {
            view('v1/web',['content'=>'请配置数据']);
        }
        $info = ArticleModel::get($id);

        return view('v1/web',['content'=>$info['content']]);
    }

    public function wxArticle() {
        $id = input('id/s', 0);
        $contet = Db::name('article')->where('id', $id)->value('content');

        return view('v1/detail',['content'=>$contet]);

    }
}
